﻿using System.Text;

namespace IniFileManager
{
	sealed internal class IniFileStructureRow
	{
		private IIniFileToken element;
		private string comment;
		internal IniFileStructureRow( IIniFileToken element, string comment )
		{
			this.element = element;
			this.comment = comment;
		}

		internal string WriteSelf()
		{
			StringBuilder result = new StringBuilder();

			result.Append( element.WriteSelf() );
			if( comment != "" )
			{
				result.Append( TextConstants.spaceBeforeComment + TextConstants.startCommentChar );
			}
			result.Append( comment );

			return result.ToString();
		}
	}
}
